#include <stdio.h>
#define N 1000
int price[N+1]={0};

int main_29()
{
    int n,avg,i;
    scanf("%d",&n);
    for (i=0;i<n ;i++ )
    {
        scanf("%d",&price[i]);
    }
    printf("%d ",(price[0]+price[1])/2);
    for (i=1;i<n-1 ;i++ )
    {
        avg=(price[i-1]+price[i]+price[i+1])/3;
        printf("%d ",avg);
    }
    printf("%d",(price[n-2]+price[n-1])/2);
	return 0;
}
